<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改教职工奖惩记录')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-awardsinfo-edit" th:object="${awardsAndPunishmentRecord}">
            <div class="form-group">
                <label class="col-sm-3 control-label">职工姓名</label>
                <div class="col-sm-8">
                    <input type="hidden" id="id" name="id" th:field="*{id}">
                    <input type="hidden" id="userId" name="userId" th:field="*{userId}">
                    <input  class="form-control" type="text" th:value="${user.userName}" readonly>
                </div>
            </div>
            <div class="form-group hidden">
                <label class="col-sm-3 control-label">奖惩类型</label>
                <div class="col-sm-8">
                    <select name="rType" class="form-control m-b" th:with="type=${@dict.getType('sc_awards_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{rType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">奖励类型</label>
                <div class="col-sm-8">
                    <select id="awardsPunishId" name="awardsPunishId" class="form-control m-b" th:with="type=${@dict.getType('sc_awards_list')}">
                        <option  th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{awardsPunishId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group hidden">
                <label class="col-sm-3 control-label">类型名称</label>
                <div class="col-sm-8">
                    <input id="awardsPunishName" name="awardsPunishName" class="form-control" th:field="*{awardsPunishName}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">获得时间</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="gainDate" id="gain_date" class="form-control" placeholder="yyyy-MM-dd" type="text" required th:field="*{gainDate}">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control" type="text" rows="3" th:field="*{remark}"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "school/awardsinfo";
        $("#form-awardsinfo-edit").validate({
            focusCleanup: true
        });

        layui.use('laydate', function(){
            var laydate = layui.laydate;
            laydate.render({
                elem: '#gain_date',
                type: 'date',
                trigger: 'click'
            });
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-awardsinfo-edit').serialize());
            }
        }
    </script>
</body>
</html>